3.734 \(\int \frac{A+B \tan (e+f x)}{(a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))} \, dx\)

Optimal. Leaf size=153 \[ -\frac{3 A-i B}{16 a^3 c f (-\tan (e+f x)+i)}+\frac{A-i B}{16 a^3 c f (\tan (e+f x)+i)}+\frac{A+i B}{12 a^3 c f (-\tan (e+f x)+i)^3}+\frac{x (2 A-i B)}{8 a^3 c}-\frac{i A}{8 a^3 c f (-\tan (e+f x)+i)^2} \]

[Out]

((2*A - I*B)*x)/(8*a^3*c) + (A + I*B)/(12*a^3*c*f*(I - Tan[e + f*x])^3) - ((I/8)*A)/(a^3*c*f*(I - Tan[e + f*x]
)^2) - (3*A - I*B)/(16*a^3*c*f*(I - Tan[e + f*x])) + (A - I*B)/(16*a^3*c*f*(I + Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.213472, antiderivative size = 153, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.073, Rules used = {3588, 77, 203} \[ -\frac{3 A-i B}{16 a^3 c f (-\tan (e+f x)+i)}+\frac{A-i B}{16 a^3 c f (\tan (e+f x)+i)}+\frac{A+i B}{12 a^3 c f (-\tan (e+f x)+i)^3}+\frac{x (2 A-i B)}{8 a^3 c}-\frac{i A}{8 a^3 c f (-\tan (e+f x)+i)^2} \]

Antiderivative was successfully verified.

[In]

Int[(A + B*Tan[e + f*x])/((a + I*a*Tan[e + f*x])^3*(c - I*c*Tan[e + f*x])),x]

[Out]

((2*A - I*B)*x)/(8*a^3*c) + (A + I*B)/(12*a^3*c*f*(I - Tan[e + f*x])^3) - ((I/8)*A)/(a^3*c*f*(I - Tan[e + f*x]
)^2) - (3*A - I*B)/(16*a^3*c*f*(I - Tan[e + f*x])) + (A - I*B)/(16*a^3*c*f*(I + Tan[e + f*x]))

Rule 3588

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(a*c)/f, Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rule 77

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{A+B \tan (e+f x)}{(a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{A+B x}{(a+i a x)^4 (c-i c x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (\frac{A+i B}{4 a^4 c^2 (-i+x)^4}+\frac{i A}{4 a^4 c^2 (-i+x)^3}+\frac{-3 A+i B}{16 a^4 c^2 (-i+x)^2}+\frac{-A+i B}{16 a^4 c^2 (i+x)^2}+\frac{2 A-i B}{8 a^4 c^2 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{A+i B}{12 a^3 c f (i-\tan (e+f x))^3}-\frac{i A}{8 a^3 c f (i-\tan (e+f x))^2}-\frac{3 A-i B}{16 a^3 c f (i-\tan (e+f x))}+\frac{A-i B}{16 a^3 c f (i+\tan (e+f x))}+\frac{(2 A-i B) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 a^3 c f}\\ &=\frac{(2 A-i B) x}{8 a^3 c}+\frac{A+i B}{12 a^3 c f (i-\tan (e+f x))^3}-\frac{i A}{8 a^3 c f (i-\tan (e+f x))^2}-\frac{3 A-i B}{16 a^3 c f (i-\tan (e+f x))}+\frac{A-i B}{16 a^3 c f (i+\tan (e+f x))}\\ \end{align*}

Mathematica [A]  time = 2.08965, size = 164, normalized size = 1.07 \[ -\frac{\sec ^2(e+f x) (3 (A (8 f x+2 i)+B (-1-4 i f x)) \cos (2 (e+f x))+(-4 B-2 i A) \cos (4 (e+f x))+24 i A f x \sin (2 (e+f x))+6 A \sin (2 (e+f x))+4 A \sin (4 (e+f x))+18 i A+3 i B \sin (2 (e+f x))+12 B f x \sin (2 (e+f x))-2 i B \sin (4 (e+f x)))}{96 a^3 c f (\tan (e+f x)-i)^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(A + B*Tan[e + f*x])/((a + I*a*Tan[e + f*x])^3*(c - I*c*Tan[e + f*x])),x]

[Out]

-(Sec[e + f*x]^2*((18*I)*A + 3*(B*(-1 - (4*I)*f*x) + A*(2*I + 8*f*x))*Cos[2*(e + f*x)] + ((-2*I)*A - 4*B)*Cos[
4*(e + f*x)] + 6*A*Sin[2*(e + f*x)] + (3*I)*B*Sin[2*(e + f*x)] + (24*I)*A*f*x*Sin[2*(e + f*x)] + 12*B*f*x*Sin[
2*(e + f*x)] + 4*A*Sin[4*(e + f*x)] - (2*I)*B*Sin[4*(e + f*x)]))/(96*a^3*c*f*(-I + Tan[e + f*x])^2)

________________________________________________________________________________________

Maple [A]  time = 0.069, size = 257, normalized size = 1.7 \begin{align*}{\frac{-{\frac{i}{8}}A}{f{a}^{3}c \left ( \tan \left ( fx+e \right ) -i \right ) ^{2}}}+{\frac{3\,A}{16\,f{a}^{3}c \left ( \tan \left ( fx+e \right ) -i \right ) }}-{\frac{{\frac{i}{16}}B}{f{a}^{3}c \left ( \tan \left ( fx+e \right ) -i \right ) }}-{\frac{A}{12\,f{a}^{3}c \left ( \tan \left ( fx+e \right ) -i \right ) ^{3}}}-{\frac{{\frac{i}{12}}B}{f{a}^{3}c \left ( \tan \left ( fx+e \right ) -i \right ) ^{3}}}-{\frac{\ln \left ( \tan \left ( fx+e \right ) -i \right ) B}{16\,f{a}^{3}c}}-{\frac{{\frac{i}{8}}\ln \left ( \tan \left ( fx+e \right ) -i \right ) A}{f{a}^{3}c}}+{\frac{A}{16\,f{a}^{3}c \left ( \tan \left ( fx+e \right ) +i \right ) }}-{\frac{{\frac{i}{16}}B}{f{a}^{3}c \left ( \tan \left ( fx+e \right ) +i \right ) }}+{\frac{\ln \left ( \tan \left ( fx+e \right ) +i \right ) B}{16\,f{a}^{3}c}}+{\frac{{\frac{i}{8}}\ln \left ( \tan \left ( fx+e \right ) +i \right ) A}{f{a}^{3}c}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^3/(c-I*c*tan(f*x+e)),x)

[Out]

-1/8*I/f/a^3/c*A/(tan(f*x+e)-I)^2+3/16/f/a^3/c/(tan(f*x+e)-I)*A-1/16*I/f/a^3/c/(tan(f*x+e)-I)*B-1/12/f/a^3/c/(
tan(f*x+e)-I)^3*A-1/12*I/f/a^3/c/(tan(f*x+e)-I)^3*B-1/16/f/a^3/c*ln(tan(f*x+e)-I)*B-1/8*I/f/a^3/c*ln(tan(f*x+e
)-I)*A+1/16/f/a^3/c/(tan(f*x+e)+I)*A-1/16*I/f/a^3/c/(tan(f*x+e)+I)*B+1/16/f/a^3/c*ln(tan(f*x+e)+I)*B+1/8*I/f/a
^3/c*ln(tan(f*x+e)+I)*A

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^3/(c-I*c*tan(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 1.05501, size = 257, normalized size = 1.68 \begin{align*} \frac{{\left (12 \,{\left (2 \, A - i \, B\right )} f x e^{\left (6 i \, f x + 6 i \, e\right )} +{\left (-3 i \, A - 3 \, B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 18 i \, A e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (6 i \, A - 3 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, A - B\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{96 \, a^{3} c f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^3/(c-I*c*tan(f*x+e)),x, algorithm="fricas")

[Out]

1/96*(12*(2*A - I*B)*f*x*e^(6*I*f*x + 6*I*e) + (-3*I*A - 3*B)*e^(8*I*f*x + 8*I*e) + 18*I*A*e^(4*I*f*x + 4*I*e)
 + (6*I*A - 3*B)*e^(2*I*f*x + 2*I*e) + I*A - B)*e^(-6*I*f*x - 6*I*e)/(a^3*c*f)

________________________________________________________________________________________

Sympy [A]  time = 4.52343, size = 342, normalized size = 2.24 \begin{align*} \begin{cases} \frac{\left (294912 i A a^{9} c^{3} f^{3} e^{10 i e} e^{- 2 i f x} + \left (16384 i A a^{9} c^{3} f^{3} e^{6 i e} - 16384 B a^{9} c^{3} f^{3} e^{6 i e}\right ) e^{- 6 i f x} + \left (98304 i A a^{9} c^{3} f^{3} e^{8 i e} - 49152 B a^{9} c^{3} f^{3} e^{8 i e}\right ) e^{- 4 i f x} + \left (- 49152 i A a^{9} c^{3} f^{3} e^{14 i e} - 49152 B a^{9} c^{3} f^{3} e^{14 i e}\right ) e^{2 i f x}\right ) e^{- 12 i e}}{1572864 a^{12} c^{4} f^{4}} & \text{for}\: 1572864 a^{12} c^{4} f^{4} e^{12 i e} \neq 0 \\x \left (- \frac{2 A - i B}{8 a^{3} c} + \frac{\left (A e^{8 i e} + 4 A e^{6 i e} + 6 A e^{4 i e} + 4 A e^{2 i e} + A - i B e^{8 i e} - 2 i B e^{6 i e} + 2 i B e^{2 i e} + i B\right ) e^{- 6 i e}}{16 a^{3} c}\right ) & \text{otherwise} \end{cases} + \frac{x \left (2 A - i B\right )}{8 a^{3} c} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))**3/(c-I*c*tan(f*x+e)),x)

[Out]

Piecewise(((294912*I*A*a**9*c**3*f**3*exp(10*I*e)*exp(-2*I*f*x) + (16384*I*A*a**9*c**3*f**3*exp(6*I*e) - 16384
*B*a**9*c**3*f**3*exp(6*I*e))*exp(-6*I*f*x) + (98304*I*A*a**9*c**3*f**3*exp(8*I*e) - 49152*B*a**9*c**3*f**3*ex
p(8*I*e))*exp(-4*I*f*x) + (-49152*I*A*a**9*c**3*f**3*exp(14*I*e) - 49152*B*a**9*c**3*f**3*exp(14*I*e))*exp(2*I
*f*x))*exp(-12*I*e)/(1572864*a**12*c**4*f**4), Ne(1572864*a**12*c**4*f**4*exp(12*I*e), 0)), (x*(-(2*A - I*B)/(
8*a**3*c) + (A*exp(8*I*e) + 4*A*exp(6*I*e) + 6*A*exp(4*I*e) + 4*A*exp(2*I*e) + A - I*B*exp(8*I*e) - 2*I*B*exp(
6*I*e) + 2*I*B*exp(2*I*e) + I*B)*exp(-6*I*e)/(16*a**3*c)), True)) + x*(2*A - I*B)/(8*a**3*c)

________________________________________________________________________________________

Giac [A]  time = 1.30702, size = 259, normalized size = 1.69 \begin{align*} -\frac{\frac{6 \,{\left (-2 i \, A - B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{3} c} + \frac{6 \,{\left (2 i \, A + B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{3} c} + \frac{6 \,{\left (2 i \, A \tan \left (f x + e\right ) + B \tan \left (f x + e\right ) - 3 \, A + 2 i \, B\right )}}{a^{3} c{\left (\tan \left (f x + e\right ) + i\right )}} + \frac{-22 i \, A \tan \left (f x + e\right )^{3} - 11 \, B \tan \left (f x + e\right )^{3} - 84 \, A \tan \left (f x + e\right )^{2} + 39 i \, B \tan \left (f x + e\right )^{2} + 114 i \, A \tan \left (f x + e\right ) + 45 \, B \tan \left (f x + e\right ) + 60 \, A - 9 i \, B}{a^{3} c{\left (\tan \left (f x + e\right ) - i\right )}^{3}}}{96 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((A+B*tan(f*x+e))/(a+I*a*tan(f*x+e))^3/(c-I*c*tan(f*x+e)),x, algorithm="giac")

[Out]

-1/96*(6*(-2*I*A - B)*log(tan(f*x + e) + I)/(a^3*c) + 6*(2*I*A + B)*log(tan(f*x + e) - I)/(a^3*c) + 6*(2*I*A*t
an(f*x + e) + B*tan(f*x + e) - 3*A + 2*I*B)/(a^3*c*(tan(f*x + e) + I)) + (-22*I*A*tan(f*x + e)^3 - 11*B*tan(f*
x + e)^3 - 84*A*tan(f*x + e)^2 + 39*I*B*tan(f*x + e)^2 + 114*I*A*tan(f*x + e) + 45*B*tan(f*x + e) + 60*A - 9*I
*B)/(a^3*c*(tan(f*x + e) - I)^3))/f